require("lualib_bundle");
__TS__SourceMapTraceBack(debug.getinfo(1).short_src, {["4"] = 1,["5"] = 1,["6"] = 10,["7"] = 10,["8"] = 10,["10"] = 11,["11"] = 15,["12"] = 10,["13"] = 19,["14"] = 20,["15"] = 20,["16"] = 20,["17"] = 21,["18"] = 20,["19"] = 20,["20"] = 19,["21"] = 25,["22"] = 26,["23"] = 25,["24"] = 29,["25"] = 30,["26"] = 31,["27"] = 29,["28"] = 34,["29"] = 35,["30"] = 35,["31"] = 35,["32"] = 35,["33"] = 36,["34"] = 36,["35"] = 36,["36"] = 36,["37"] = 34,["38"] = 39,["39"] = 39,["40"] = 39,["42"] = 39,["43"] = 39,["45"] = 40,["46"] = 42,["47"] = 43,["49"] = 51,["50"] = 52,["52"] = 54,["53"] = 54,["54"] = 55,["55"] = 56,["56"] = 58,["57"] = 59,["59"] = 54,["62"] = 63,["64"] = 66,["65"] = 39,["66"] = 10});
local ____exports = {}
local ____Now = require("solar.tween.Now")
local now = ____Now.default
____exports.default = __TS__Class()
local Group = ____exports.default
Group.name = "Group"
function Group.prototype.____constructor(self)
    self._tweens = {}
    self._tweensAddedDuringUpdate = {}
end
function Group.prototype.getAll(self)
    return __TS__ArrayMap(
        __TS__ObjectKeys(self._tweens),
        function(____, tweenId)
            return self._tweens[tweenId]
        end
    )
end
function Group.prototype.removeAll(self)
    self._tweens = {}
end
function Group.prototype.add(self, tween)
    self._tweens[tween:getId()] = tween
    self._tweensAddedDuringUpdate[tween:getId()] = tween
end
function Group.prototype.remove(self, tween)
    __TS__Delete(
        self._tweens,
        tween:getId()
    )
    __TS__Delete(
        self._tweensAddedDuringUpdate,
        tween:getId()
    )
end
function Group.prototype.update(self, time, preserve)
    if time == nil then
        time = now(nil)
    end
    if preserve == nil then
        preserve = false
    end
    local tweenIds = __TS__ObjectKeys(self._tweens)
    if #tweenIds == 0 then
        return false
    end
    while #tweenIds > 0 do
        self._tweensAddedDuringUpdate = {}
        do
            local i = 0
            while i < #tweenIds do
                local tween = self._tweens[tweenIds[i + 1]]
                local autoStart = not preserve
                if tween and tween:update(time, autoStart) == false and not preserve then
                    __TS__Delete(self._tweens, tweenIds[i + 1])
                end
                i = i + 1
            end
        end
        tweenIds = __TS__ObjectKeys(self._tweensAddedDuringUpdate)
    end
    return true
end
____exports.default = Group
return ____exports
